import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.sql.Connection;


import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTable;
import javax.swing.JScrollPane;


/**
 * Dialog that shows todays Appointments
 * @author Vishnu
 *
 */
@SuppressWarnings("serial")
public class DailyAppointmentSheet extends JDialog {

	private final JPanel contentPanel = new JPanel();
	private MedAppController mac;
	@SuppressWarnings("unused")
	private Connection con;
	private JTable table;

	/**
	 * Constructor for the DailyAppointmentSheet
	 * @param mac MedAppController mac
	 */
	public DailyAppointmentSheet(final MedAppController mac) {
		setTitle("Daily Appointment Sheet");
		setResizable(false);
		this.mac = mac;
		con = mac.getCon();
		
		setBounds(100, 100, 787, 413);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(null);
		{
			JScrollPane scrollPane = new JScrollPane();
			scrollPane.setBounds(10, 11, 751, 320);
			contentPanel.add(scrollPane);
			
			table = new JTable(myModel());
			table.setFillsViewportHeight(true);
			scrollPane.setViewportView(table);
		}
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
		}
	}
	
	
	/**
	 * Creates the model for the appointment table
	 * @return DailyApptModel is the model for the appointment model
	 */
	public DailyApptModel myModel(){
		DailyApptModel dam = new DailyApptModel(mac);
		return dam;
	}
}
